/*
 * @Author: doing
 * @Date: 2023-08-20 07:41:37
 * @LastEditors: git config user.name && git config user.email
 * @LastEditTime: 2023-08-26 19:13:08
 * @FilePath: \background-management-system\src\api\advert.js
 * @Description: 
 * 广告接口
 * Copyright (c) 2023 by 1540265624@qq.com, All Rights Reserved. 
 */
import axios from '~/axios.js'

//广告列表
export function getAdvertList(body){
    return axios.post('/content/advert/search',body)
}

//新增广告
export function addAdvert(body){
    return axios.post('/content/advert',body)
}

//根据id删除广告
export function deleteAdvert(id){
    return axios.delete(`/content/advert/${id}`)
}

//修改广告信息
export function updataAdvert(body){
    return axios.put('/content/advert',body)
}

//上传图片接口 data直接是FormData对象
export function uploadPic(body){
    return axios.post('/content/file/upload',body)
}

//删除图片接口
export function deletePic(fileUrl){
    return axios.delete('/content/file/delete',{
        params:{
            fileUrl
        }
    })
}
